#include <bits/stdc++.h>
using namespace std;

int n,m;
int A[25][25];
int dir[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
bool isMax(pair<int,int> index);

int main(){
    cin>>n>>m;
    vector<pair<int,pair<int,int>>> ans;
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= m; ++j)
            cin>>A[i][j];

    for (int i = 2; i < n; ++i)
        for (int j = 2; j < m; ++j)
            if (isMax({i,j}))
                ans.push_back({A[i][j],{i,j}});

    if (ans.size()>0)
        for (int i = 0; i < ans.size(); ++i)
            cout<<ans[i].first<<' '<<ans[i].second.first<<' '<<ans[i].second.second<<endl;
    else
        cout<<"None "<<n<<' '<<m<<endl;
    return 0;
}

bool isMax(pair<int,int> index){
    for (int i = 0; i < 4; ++i)
        if (A[index.first+dir[i][0]][index.second+dir[i][1]]>=A[index.first][index.second])
            return false;
    return true;
}